Skip to content

refactor(cli): separate parser data and main function logic#1670

Closed
bearomorphism wants to merge 10 commits into
commitizen-tools:v4-10-1from
bearomorphism:refactor-parser
Closed

refactor(cli): separate parser data and main function logic#1670
bearomorphism wants to merge 10 commits into
commitizen-tools:v4-10-1from
bearomorphism:refactor-parser

Conversation

@bearomorphism

Copy link
Copy Markdown
Collaborator

The main function is getting a bit large. I believe it is better to separate the core main function logic with cli configuration data for maintainability.

Checklist

Code Changes

  • Run poetry all locally to ensure this change passes linter check and tests

@woile

woile commented Dec 3, 2025

Copy link
Copy Markdown
Member

I'm not sure I like splitting the cli into 2 files. I expect to find the args of a cli in the cli.py

@Lee-W

Lee-W commented Dec 4, 2025

Copy link
Copy Markdown
Member

I don't have a strong opinion on this one 🤔 either way works for me. so I'll let you both discuss whether we want to make change like this one

@bearomorphism

Copy link
Copy Markdown
Collaborator Author

I'm not sure I like splitting the cli into 2 files. I expect to find the args of a cli in the cli.py

I don't expect a main function to be so large, but I also see your point. Maybe we group cli related thing into a file, and other things, such as excepthook and configuration file related things, into another file?

@bearomorphism

bearomorphism commented Dec 4, 2025

Copy link
Copy Markdown
Collaborator Author

For example

  • cli.py: CLI related logic and data, will export to main.py
  • main.py: entry point of cz, with configuration file resolution

@bearomorphism bearomorphism marked this pull request as draft December 4, 2025 03:23
@woile

woile commented Dec 4, 2025

Copy link
Copy Markdown
Member

That'd be fine by me

@bearomorphism bearomorphism deleted the branch commitizen-tools:v4-10-1 December 11, 2025 15:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants